import http from '@/api'
// import type IAuth from 'IAuth'

const userUrl = `${import.meta.env.VITE_APP_API_AUTH_URL}/user`
const userUrl1 = `${import.meta.env.VITE_APP_API_ADMIN_URL}`

// 获取当前用户可访问菜单
const getUserMenu = () => {
  return http.get(`${userUrl}/menus?ownedSystem=stManage`)
}

// 获取所有菜单列表
const getMenu = (params: ApiAuth.menusReq) => {
  return http.get(`${userUrl1}/menus`, params)
}
// 查询子菜单id
const getMenuChild = (params: any) => {
  return http.get(`${userUrl1}/menus/child`, params)
}

const MenuService = {
  getUserMenu: getUserMenu,
  getMenu: getMenu,
  getMenuChild: getMenuChild
}

export default MenuService
